// import React, { Component } from 'react';
// import { Outlet } from 'react-router-dom';
import "../component/left/Left.css";

import Left from "../component/left/Left-menu";
import Header from "../component/right/Header";
import List from "../component/right/list";
import { useEffect, useState } from "react";


const Home = () => {
  
  // 面包屑 
  const [matches, setMatches] = useState(() => {
    return JSON.parse(window.sessionStorage.getItem('matches') as any) || []
  })
  // 页面开始加载的时候更新面包屑数据
  useEffect(() => {
    let matche = JSON.parse(window.sessionStorage.getItem('matches') as any)
    setMatches(matche)
  }, [])

  return (
    <>
      <div className='root'>
        {/* 左边菜单栏 */}
        <Left setMatches={setMatches} />
        {/* 右边 */}
        <div className='right'>
          {/* 头部 */}
          <Header  matches={matches} ></Header>
          {/* 列表 */}
          <List></List>
        </div>

      </div>

    </>
  );
}

export default Home;